cmake_minimum_required(VERSION 2.8)
set(CMAKE_USE_RELATIVE_PATHS true)
cmake_policy(SET CMP0003 NEW)

add_definitions(-DUNICODE -D_UNICODE)

message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "add a debug postfix, usually _dd on windows" FORCE)
set(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "add a debug postfix, usually _dd on windows" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/Install" CACHE STRING "default intall to ${CMAKE_BINARY_DIR}" FORCE)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Install" CACHE STRING "default library directory" FORCE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Install" CACHE STRING "default runtime directory" FORCE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Install" CACHE STRING "default archive directory" FORCE)


if (CMAKE_BUILD_TYPE STREQUAL "")
    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "add a debug postfix, usually _dd on windows" FORCE)
endif(CMAKE_BUILD_TYPE STREQUAL "")

project(CameraControlSystem)

set(CMAKE_MODULE_PATH 
  "${CMAKE_SOURCE_DIR}/CMake"
  "${CMAKE_SOURCE_DIR}/CMake/Packages"
  "${CMAKE_SOURCE_DIR}/CMake/Utils"
)

include(FindPkgMacros)

find_package(Ogre)
find_package(OIS)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/CameraControlSystem/inc)
link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})

add_subdirectory(CameraControlSystem)
add_subdirectory(CameraControlSystemDemo)
#add_subdirectory(CameraControlSystemSDKDemo)